package cn.momoshenchi.pojo;

import com.baomidou.mybatisplus.annotation.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * @author: momoshenchi
 * @date: 2021/6/7 - 15:31
 */
@TableName(value ="article")
public class Article implements Serializable {
    /**
     * 
     */

    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 
     */
    private String title;

    /**
     * 
     */
    private String content;

    @TableField(fill = FieldFill.INSERT)
    private  Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    /**
     * 
     */
    private String nickname;

    /**
     * 
     */
    private String photoa;

    /**
     * 
     */
    private String photob;

    /**
     * 
     */
    private String photoc;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public Long getId() {
        return id;
    }

    /**
     * 
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 
     */
    public String getTitle() {
        return title;
    }

    /**
     * 
     */
    public void setTitle(String title) {
        this.title = title;
    }
    public Date getCreateTime()
    {
        return createTime;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }

    public Date getUpdateTime()
    {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime)
    {
        this.updateTime = updateTime;
    }
    /**
     * 
     */
    public String getContent() {
        return content;
    }

    /**
     * 
     */
    public void setContent(String content) {
        this.content = content;
    }



    /**
     * 
     */
    public String getNickname() {
        return nickname;
    }

    /**
     * 
     */
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    /**
     * 
     */
    public String getPhotoa() {
        return photoa;
    }

    /**
     * 
     */
    public void setPhotoa(String photoa) {
        this.photoa = photoa;
    }

    /**
     * 
     */
    public String getPhotob() {
        return photob;
    }

    /**
     * 
     */
    public void setPhotob(String photob) {
        this.photob = photob;
    }

    /**
     * 
     */
    public String getPhotoc() {
        return photoc;
    }

    /**
     * 
     */
    public void setPhotoc(String photoc) {
        this.photoc = photoc;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Article other = (Article) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getNickname() == null ? other.getNickname() == null : this.getNickname().equals(other.getNickname()))
            && (this.getPhotoa() == null ? other.getPhotoa() == null : this.getPhotoa().equals(other.getPhotoa()))
            && (this.getPhotob() == null ? other.getPhotob() == null : this.getPhotob().equals(other.getPhotob()))
            && (this.getPhotoc() == null ? other.getPhotoc() == null : this.getPhotoc().equals(other.getPhotoc()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getNickname() == null) ? 0 : getNickname().hashCode());
        result = prime * result + ((getPhotoa() == null) ? 0 : getPhotoa().hashCode());
        result = prime * result + ((getPhotob() == null) ? 0 : getPhotob().hashCode());
        result = prime * result + ((getPhotoc() == null) ? 0 : getPhotoc().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", title=").append(title);
        sb.append(", content=").append(content);
        sb.append(", nickname=").append(nickname);
        sb.append(", photoa=").append(photoa);
        sb.append(", photob=").append(photob);
        sb.append(", photoc=").append(photoc);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}